
#include <QPushButton>

class QCustomButton : public QPushButton
{
    Q_OBJECT

public:
    explicit QCustomButton(int index, QWidget *parent = nullptr);

signals:
    // 发射 clicked(int) 信号，把帖子在 QListWidget 中的索引传递给槽函数
    void clicked(int index);

protected:
    void mousePressEvent(QMouseEvent *event) override;

private:
    int m_index;
};
